import pandas as pd
from typing import Tuple

class DataLoader:
    @staticmethod
    def load_indicators() -> pd.DataFrame:
        df_indicators = pd.read_csv("data/指标.csv")
        df_themes = pd.read_csv("data/主题.csv")
        
        return pd.merge(
            df_indicators, df_themes,
            left_on="指标对应主题", right_on="主题代码",
            how="left"
        )[["指标代码", "指标名称", "主题描述", "自定义计算表达式"]]

    @staticmethod
    def load_dimensions() -> pd.DataFrame:
        df_dimension = pd.read_csv("data/维度.csv")
        df_theme_dim = pd.read_csv("data/主题维度.csv")
        df_theme = pd.read_csv("data/主题.csv")
        
        merged = pd.merge(
            df_theme_dim, df_dimension,
            left_on="关联维度", right_on="维度代码",
            how="inner"
        )
        return pd.merge(
            merged, df_theme,
            left_on="归属主题", right_on="主题代码",
            how="inner"
        )[["维度代码", "维度描述", "主题描述"]]